package com.common.app.widget.mybanner;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.bumptech.glide.request.RequestOptions;
import com.common.app.R;
import com.common.base.utils.transform.GlideTopRoundTransform;

public class SimpleOverlayAdapter extends BaseOverlayPageAdapter {
    private LayoutInflater mInflater;
    private View mCurrentView;

    public SimpleOverlayAdapter(Context context) {
        super(context, new RequestOptions().error(R.mipmap.ic_logo_launcher).placeholder(R.mipmap.ic_logo_launcher).transform(new GlideTopRoundTransform(10)));
        mInflater = LayoutInflater.from(context);
    }

    public SimpleOverlayAdapter(Context context, RequestOptions imageOptions) {
        super(context, imageOptions);
        mInflater = LayoutInflater.from(context);
    }

    @Override
    protected View itemView() {
        return mInflater.inflate(R.layout.item_invite_friends_viewpager, null);
    }

    @Override
    public void setPrimaryItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
//        super.setPrimaryItem(container, position, object);
        mCurrentView = (View)object;
    }

    public View getPrimaryItem() {
        return mCurrentView;
    }
}
